﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Printing;
using System.Drawing.Imaging;
using System.Collections;
using System.IO;

namespace testePrintForm
{
    public partial class Form1 : Form
    {
        private Font mainTextFont = new Font("Times New Roman", 14);
        private Font subTextFont = new Font("Times New Roman", 12);
        private PageSettings storedPageSettings;

        public Form1()
        {
            InitializeComponent();
            for (int i = 0; i < 10; i++)
            {
                Color backColor = Color.White;
                int count = dataGridView1.Rows.Count;
                DataGridViewRow row = new DataGridViewRow();

                DataGridViewCellStyle style = new DataGridViewCellStyle();
                if (count % 2 == 0)
                    backColor = Color.GreenYellow;
                style.BackColor = backColor; // the color change           
                row.DefaultCellStyle = style;
                row.Height = 20;
                row.MinimumHeight = 30;
                object[] data = new object[] { "a", true };
                row.CreateCells(dataGridView1, data);
                dataGridView1.Rows.Add(row);
            }
           
 
        }

        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
          
            
           
        }

        private void WriteMetricsToConsole(PrintPageEventArgs ev)
        {
         

        }

        private void PaintDocument(Graphics g)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {            
            if (printPreviewDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                printDocument1.Print();
            }
        }
        
    }
}
